# -*- coding: utf-8 -*-
import allure
from common.page import Page
from regression_service.funtion.fun_main import Main
from regression_service.page_elements.el_application_management import application_management


class Application(Main):
    @allure.step('step:新建应用')
    def create_application(self):
        Page.click(application_management,'应用管理','新建应用')
        return self

    @allure.step('step:点击PC端全新应用')
    def click_pc_new_application(self):
        Page.click(application_management,'新建应用页面','PC端全新应用')
        return self

    @allure.step('step:点击确定')
    def click_determine(self):
        Page.click(application_management,'新建应用页面','确定')
        return self

    @allure.step('step:输入应用名称')
    def sendkeys_application_name(self,data):
        Page.send_key(application_management,'新建PC端全新应用','应用名称',data)
        return self

    @allure.step('step:输入应用描述')
    def sendkeys_application_describe(self,data):
        Page.send_key(application_management,'新建PC端全新应用','应用描述',data)
        return self

    @allure.step('step:点击下一步')
    def click_next(self):
        Page.click(application_management,'新建PC端全新应用','下一步')
        return self

    @allure.step('step:输入代码仓库_仓库名称')
    def sendkeys_code_warehouse_name(self,data):
        Page.send_key(application_management,'新建PC端全新应用','代码仓库_仓库名称',data)
        return self

    @allure.step('step:输入代码仓库_仓库描述')
    def sendkeys_code_warehouse_describe(self,data):
        Page.send_key(application_management,'新建PC端全新应用','代码仓库_仓库描述',data)
        return self

    @allure.step('step:输入制品仓库_仓库名称')
    def sendkeys_product_warehouse_name(self,data):
        Page.send_key(application_management,'新建PC端全新应用','制品仓库_仓库名称',data)
        return self

    @allure.step('step:输入制品仓库_仓库描述')
    def sendkeys_product_warehouse_describe(self,data):
        Page.send_key(application_management,'新建PC端全新应用','制品仓库_仓库描述',data)
        return self

    @allure.step('step:点击完成')
    def click_complete(self):
        Page.click(application_management,'新建PC端全新应用','完成')
        return self
